3.1.89 \(\int (a+b \cot (e+f x))^m (d \tan (e+f x))^n \, dx\) [89]

Optimal. Leaf size=193 \[ -\frac {F_1\left (1-n;-m,1;2-n;-\frac {b \cot (e+f x)}{a},-i \cot (e+f x)\right ) \cot (e+f x) (a+b \cot (e+f x))^m \left (1+\frac {b \cot (e+f x)}{a}\right )^{-m} (d \tan (e+f x))^n}{2 f (1-n)}-\frac {F_1\left (1-n;-m,1;2-n;-\frac {b \cot (e+f x)}{a},i \cot (e+f x)\right ) \cot (e+f x) (a+b \cot (e+f x))^m \left (1+\frac {b \cot (e+f x)}{a}\right )^{-m} (d \tan (e+f x))^n}{2 f (1-n)} \]

[Out]

-1/2*AppellF1(1-n,1,-m,2-n,-I*cot(f*x+e),-b*cot(f*x+e)/a)*cot(f*x+e)*(a+b*cot(f*x+e))^m*(d*tan(f*x+e))^n/f/(1-
n)/((1+b*cot(f*x+e)/a)^m)-1/2*AppellF1(1-n,1,-m,2-n,I*cot(f*x+e),-b*cot(f*x+e)/a)*cot(f*x+e)*(a+b*cot(f*x+e))^
m*(d*tan(f*x+e))^n/f/(1-n)/((1+b*cot(f*x+e)/a)^m)

________________________________________________________________________________________

Rubi [A]
time = 0.20, antiderivative size = 193, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {4327, 3656, 926, 140, 138} \begin {gather*} -\frac {\cot (e+f x) (d \tan (e+f x))^n (a+b \cot (e+f x))^m \left (\frac {b \cot (e+f x)}{a}+1\right )^{-m} F_1\left (1-n;-m,1;2-n;-\frac {b \cot (e+f x)}{a},-i \cot (e+f x)\right )}{2 f (1-n)}-\frac {\cot (e+f x) (d \tan (e+f x))^n (a+b \cot (e+f x))^m \left (\frac {b \cot (e+f x)}{a}+1\right )^{-m} F_1\left (1-n;-m,1;2-n;-\frac {b \cot (e+f x)}{a},i \cot (e+f x)\right )}{2 f (1-n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Cot[e + f*x])^m*(d*Tan[e + f*x])^n,x]

[Out]

-1/2*(AppellF1[1 - n, -m, 1, 2 - n, -((b*Cot[e + f*x])/a), (-I)*Cot[e + f*x]]*Cot[e + f*x]*(a + b*Cot[e + f*x]
)^m*(d*Tan[e + f*x])^n)/(f*(1 - n)*(1 + (b*Cot[e + f*x])/a)^m) - (AppellF1[1 - n, -m, 1, 2 - n, -((b*Cot[e + f
*x])/a), I*Cot[e + f*x]]*Cot[e + f*x]*(a + b*Cot[e + f*x])^m*(d*Tan[e + f*x])^n)/(2*f*(1 - n)*(1 + (b*Cot[e +
f*x])/a)^m)

Rule 138

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[c^n*e^p*((b*x)^(m +
 1)/(b*(m + 1)))*AppellF1[m + 1, -n, -p, m + 2, (-d)*(x/c), (-f)*(x/e)], x] /; FreeQ[{b, c, d, e, f, m, n, p},
 x] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])

Rule 140

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_Symbol] :> Dist[c^IntPart[n]*((c +
d*x)^FracPart[n]/(1 + d*(x/c))^FracPart[n]), Int[(b*x)^m*(1 + d*(x/c))^n*(e + f*x)^p, x], x] /; FreeQ[{b, c, d
, e, f, m, n, p}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] &&  !GtQ[c, 0]

Rule 926

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegr
and[(d + e*x)^m*(f + g*x)^n, 1/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g, m, n}, x] && NeQ[c*d^2 + a*e^2,
 0] &&  !IntegerQ[m] &&  !IntegerQ[n]

Rule 3656

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Wit
h[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + b*ff*x)^m*((c + d*ff*x)^n/(1 + ff^2*x^2)), x]
, x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] &&
NeQ[c^2 + d^2, 0]

Rule 4327

Int[(u_)*((c_.)*tan[(a_.) + (b_.)*(x_)])^(m_.), x_Symbol] :> Dist[(c*Cot[a + b*x])^m*(c*Tan[a + b*x])^m, Int[A
ctivateTrig[u]/(c*Cot[a + b*x])^m, x], x] /; FreeQ[{a, b, c, m}, x] &&  !IntegerQ[m] && KnownCotangentIntegran
dQ[u, x]

Rubi steps

\begin {align*} \int (a+b \cot (e+f x))^m (d \tan (e+f x))^n \, dx &=\left ((d \cot (e+f x))^n (d \tan (e+f x))^n\right ) \int (d \cot (e+f x))^{-n} (a+b \cot (e+f x))^m \, dx\\ &=-\frac {\left ((d \cot (e+f x))^n (d \tan (e+f x))^n\right ) \text {Subst}\left (\int \frac {(d x)^{-n} (a+b x)^m}{1+x^2} \, dx,x,\cot (e+f x)\right )}{f}\\ &=-\frac {\left ((d \cot (e+f x))^n (d \tan (e+f x))^n\right ) \text {Subst}\left (\int \left (\frac {i (d x)^{-n} (a+b x)^m}{2 (i-x)}+\frac {i (d x)^{-n} (a+b x)^m}{2 (i+x)}\right ) \, dx,x,\cot (e+f x)\right )}{f}\\ &=-\frac {\left (i (d \cot (e+f x))^n (d \tan (e+f x))^n\right ) \text {Subst}\left (\int \frac {(d x)^{-n} (a+b x)^m}{i-x} \, dx,x,\cot (e+f x)\right )}{2 f}-\frac {\left (i (d \cot (e+f x))^n (d \tan (e+f x))^n\right ) \text {Subst}\left (\int \frac {(d x)^{-n} (a+b x)^m}{i+x} \, dx,x,\cot (e+f x)\right )}{2 f}\\ &=-\frac {\left (i (d \cot (e+f x))^n (a+b \cot (e+f x))^m \left (1+\frac {b \cot (e+f x)}{a}\right )^{-m} (d \tan (e+f x))^n\right ) \text {Subst}\left (\int \frac {(d x)^{-n} \left (1+\frac {b x}{a}\right )^m}{i-x} \, dx,x,\cot (e+f x)\right )}{2 f}-\frac {\left (i (d \cot (e+f x))^n (a+b \cot (e+f x))^m \left (1+\frac {b \cot (e+f x)}{a}\right )^{-m} (d \tan (e+f x))^n\right ) \text {Subst}\left (\int \frac {(d x)^{-n} \left (1+\frac {b x}{a}\right )^m}{i+x} \, dx,x,\cot (e+f x)\right )}{2 f}\\ &=-\frac {F_1\left (1-n;-m,1;2-n;-\frac {b \cot (e+f x)}{a},-i \cot (e+f x)\right ) \cot (e+f x) (a+b \cot (e+f x))^m \left (1+\frac {b \cot (e+f x)}{a}\right )^{-m} (d \tan (e+f x))^n}{2 f (1-n)}-\frac {F_1\left (1-n;-m,1;2-n;-\frac {b \cot (e+f x)}{a},i \cot (e+f x)\right ) \cot (e+f x) (a+b \cot (e+f x))^m \left (1+\frac {b \cot (e+f x)}{a}\right )^{-m} (d \tan (e+f x))^n}{2 f (1-n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]
time = 3.30, size = 0, normalized size = 0.00 \begin {gather*} \int (a+b \cot (e+f x))^m (d \tan (e+f x))^n \, dx \end {gather*}

Verification is not applicable to the result.

[In]

Integrate[(a + b*Cot[e + f*x])^m*(d*Tan[e + f*x])^n,x]

[Out]

Integrate[(a + b*Cot[e + f*x])^m*(d*Tan[e + f*x])^n, x]

________________________________________________________________________________________

Maple [F]
time = 0.77, size = 0, normalized size = 0.00 \[\int \left (a +b \cot \left (f x +e \right )\right )^{m} \left (d \tan \left (f x +e \right )\right )^{n}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cot(f*x+e))^m*(d*tan(f*x+e))^n,x)

[Out]

int((a+b*cot(f*x+e))^m*(d*tan(f*x+e))^n,x)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(f*x+e))^m*(d*tan(f*x+e))^n,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(f*x+e))^m*(d*tan(f*x+e))^n,x, algorithm="fricas")

[Out]

integral((b*cot(f*x + e) + a)^m*(d*tan(f*x + e))^n, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (d \tan {\left (e + f x \right )}\right )^{n} \left (a + b \cot {\left (e + f x \right )}\right )^{m}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(f*x+e))**m*(d*tan(f*x+e))**n,x)

[Out]

Integral((d*tan(e + f*x))**n*(a + b*cot(e + f*x))**m, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(f*x+e))^m*(d*tan(f*x+e))^n,x, algorithm="giac")

[Out]

integrate((b*cot(f*x + e) + a)^m*(d*tan(f*x + e))^n, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n\,{\left (a+b\,\mathrm {cot}\left (e+f\,x\right )\right )}^m \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*tan(e + f*x))^n*(a + b*cot(e + f*x))^m,x)

[Out]

int((d*tan(e + f*x))^n*(a + b*cot(e + f*x))^m, x)

________________________________________________________________________________________